var assert = require('assert');
var should = require('should');
var util = require('util');
var zlib = require('zlib');
var _ = require('lodash');
var randomUtil = require('../../app/util/randomUtil');
var dataApi = require('../../app/libs/dataApi');
var config = require('../config');

suite('测试randomRewardUtil', function () {
    suite('getReward', function () {
        test('获取随机奖励', function () {
            var carbon_random_reward_all_conf = dataApi.carbon_random_reward.all();
            _.each(carbon_random_reward_all_conf, function (value, key) {
                _.size(randomUtil.sample(value, 3)).should.eql(3);
                _.size(randomUtil.sample(value, 1)).should.eql(1);
            });
        });
    });
});
